package com.dongqi.camera.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 摄像头
 *
 * @TableName camera
 */
@TableName("camera")
public class CameraEntity implements Serializable {
    /**
     * id
     */
    private Long id;

    /**
     * 设备编号
     */
    private String deviceNo;

    /**
     * 摄像头id
     */
    private String cameraId;

    /**
     * 摄像头名称
     */
    private String cameraName;

    /**
     * 工作状态
     */
    private String status;

    /**
     * 安装时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date installTime;

    /**
     * 最近检修时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date repairTime;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    /**
     * 设备序列号
     */
    private String serialNo;

    /**
     * 通道
     */
    private String channelNo;

    /**
     * 流播放协议 （1-ezopen、2-hls、3-rtmp、4-flv）
     */
    private String protocol;

    /**
     * 返回前端的url
     */
    private String url;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public CameraEntity(Long id, String deviceNo, String cameraId, String cameraName, String status, Date installTime, Date repairTime, Date createTime, Date updateTime, String serialNo, String channelNo, String protocol, String url) {
        this.id = id;
        this.deviceNo = deviceNo;
        this.cameraId = cameraId;
        this.cameraName = cameraName;
        this.status = status;
        this.installTime = installTime;
        this.repairTime = repairTime;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.serialNo = serialNo;
        this.channelNo = channelNo;
        this.protocol = protocol;
        this.url = url;
    }

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    public Long getId() {
        return id;
    }

    /**
     * id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 设备编号
     */
    public String getDeviceNo() {
        return deviceNo;
    }

    /**
     * 设备编号
     */
    public void setDeviceNo(String deviceNo) {
        this.deviceNo = deviceNo;
    }

    /**
     * 摄像头id
     */
    public String getCameraId() {
        return cameraId;
    }

    /**
     * 摄像头id
     */
    public void setCameraId(String cameraId) {
        this.cameraId = cameraId;
    }

    /**
     * 摄像头名称
     */
    public String getCameraName() {
        return cameraName;
    }

    /**
     * 摄像头名称
     */
    public void setCameraName(String cameraName) {
        this.cameraName = cameraName;
    }

    /**
     * 工作状态
     */
    public String getStatus() {
        return status;
    }

    /**
     * 工作状态
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * 安装时间
     */
    public Date getInstallTime() {
        return installTime;
    }

    /**
     * 安装时间
     */
    public void setInstallTime(Date installTime) {
        this.installTime = installTime;
    }

    /**
     * 最近检修时间
     */
    public Date getRepairTime() {
        return repairTime;
    }

    /**
     * 最近检修时间
     */
    public void setRepairTime(Date repairTime) {
        this.repairTime = repairTime;
    }

    /**
     * 创建时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 修改时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 修改时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getSerialNo() {
        return serialNo;
    }

    public void setSerialNo(String serialNo) {
        this.serialNo = serialNo;
    }

    public String getChannelNo() {
        return channelNo;
    }

    public void setChannelNo(String channelNo) {
        this.channelNo = channelNo;
    }

    /**
     * 备用3
     */
    public String getProtocol() {
        return protocol;
    }

    /**
     * 备用3
     */
    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CameraEntity other = (CameraEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getDeviceNo() == null ? other.getDeviceNo() == null : this.getDeviceNo().equals(other.getDeviceNo()))
                && (this.getCameraId() == null ? other.getCameraId() == null : this.getCameraId().equals(other.getCameraId()))
                && (this.getCameraName() == null ? other.getCameraName() == null : this.getCameraName().equals(other.getCameraName()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getInstallTime() == null ? other.getInstallTime() == null : this.getInstallTime().equals(other.getInstallTime()))
                && (this.getRepairTime() == null ? other.getRepairTime() == null : this.getRepairTime().equals(other.getRepairTime()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
                && (this.getSerialNo() == null ? other.getSerialNo() == null : this.getSerialNo().equals(other.getSerialNo()))
                && (this.getChannelNo() == null ? other.getChannelNo() == null : this.getChannelNo().equals(other.getChannelNo()))
                && (this.getProtocol() == null ? other.getProtocol() == null : this.getProtocol().equals(other.getProtocol()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDeviceNo() == null) ? 0 : getDeviceNo().hashCode());
        result = prime * result + ((getCameraId() == null) ? 0 : getCameraId().hashCode());
        result = prime * result + ((getCameraName() == null) ? 0 : getCameraName().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getInstallTime() == null) ? 0 : getInstallTime().hashCode());
        result = prime * result + ((getRepairTime() == null) ? 0 : getRepairTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getSerialNo() == null) ? 0 : getSerialNo().hashCode());
        result = prime * result + ((getChannelNo() == null) ? 0 : getChannelNo().hashCode());
        result = prime * result + ((getProtocol() == null) ? 0 : getProtocol().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", deviceNo=").append(deviceNo);
        sb.append(", cameraId=").append(cameraId);
        sb.append(", cameraName=").append(cameraName);
        sb.append(", status=").append(status);
        sb.append(", installTime=").append(installTime);
        sb.append(", repairTime=").append(repairTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", bak1=").append(serialNo);
        sb.append(", bak2=").append(channelNo);
        sb.append(", bak3=").append(protocol);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}